package palmapi

import (
	"gitee.com/chenrh/palmhosp/palmgo/app"
	m "gitee.com/chenrh/palmhosp/palmgo/palmapi/models"
	"gorm.io/gorm"
)

// AutoMigrate 自动迁移数据库
func AutoMigrate() {
	db := app.GetDB()

	db.AutoMigrate(&m.AppUser{}, &m.AppCard{}, &m.AppCardCharge{}, &m.AppGuahao{}, &m.AppGuahaoYvYue{}, &m.AppReport{})

	db.AutoMigrate(&m.AppPayment{}, &m.AppPaymentList{})

	if app.AppConfig.AutoCreateAdminAccount == "y" {
		autoCreateAdminAccount(db)
	}
}

func autoCreateAdminAccount(db *gorm.DB) {

}
